import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Login from './views/Login.vue'
import Article from './views/Article.vue'
import News from './views/News.vue'
import NewsDetail from './views/NewsDetail.vue'
import Hot from './views/Hot.vue'
import Tv from './components/Tv.vue'
import Film from './components/Film.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/toLogin',
      name: 'login',
      component: Login
    },
    {
      path: '/article/:id',
      name: 'article',
      component: Article
    },
    {
      path: '/news',
      name: 'news',
      component: News,
      children: [
        {
          path: 'tv',
          name: 'tv',
          component: Tv
        },
        {
          path: 'film',
          name: 'film',
          component: Film
        },
      ]
    },
    {
      path: '/news/:id',
      name: 'NewsDetail',
      component: NewsDetail
    },
    {
      path: '/hot',
      name: 'hot',
      component: Hot
    },
  ]
})
